wayland: Add sequences for touchpad gestures
authorMatthias Clasen <mclasen@redhat.com>
Thu, 16 Dec 2021 01:33:03 +0000 (20:33 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 16 Dec 2021 02:58:57 +0000 (21:58 -0500)
It makes sense.

gdk/wayland/gdkdevice-wayland.c

index 24633ea7d3708a1eaacba5a5642a136ce8e4631f..d82db04fb2b319b6337198c0b44c0896aca4eee4 100644 (file)
@@ -137,6 +137,7 @@ struct _GdkWaylandPointerData {
   guint cursor_timeout_id;
   guint cursor_image_index;
   guint cursor_image_delay;
+  guint touchpad_event_sequence;
 
   guint current_output_scale;
   GSList *pointer_surface_outputs;
@@ -2667,8 +2668,11 @@ emit_gesture_swipe_event (GdkWaylandSeat          *seat,
 
   seat->pointer_info.time = _time;
 
+  if (phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN)
+    seat->pointer_info.touchpad_event_sequence++;
+
   event = gdk_touchpad_event_new_swipe (seat->pointer_info.focus,
-                                        NULL,
+                                        GDK_SLOT_TO_EVENT_SEQUENCE (seat->pointer_info.touchpad_event_sequence),
                                         seat->logical_pointer,
                                         _time,
                                         device_get_modifiers (seat->logical_pointer),
@@ -2764,8 +2768,11 @@ emit_gesture_pinch_event (GdkWaylandSeat          *seat,
 
   seat->pointer_info.time = _time;
 
+  if (phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN)
+    seat->pointer_info.touchpad_event_sequence++;
+
   event = gdk_touchpad_event_new_pinch (seat->pointer_info.focus,
-                                        NULL,
+                                        GDK_SLOT_TO_EVENT_SEQUENCE (seat->pointer_info.touchpad_event_sequence),
                                         seat->logical_pointer,
                                         _time,
                                         device_get_modifiers (seat->logical_pointer),